//
// Created by Joey on 2019/12/22.
// 人事管理系统
// g++ ./*.cpp ..\..\other\TerminalUtils.cpp ..\..\libs\lib_json\*.cpp

#include"personnelManager.h"
#include "../../other/TerminalUtils.h"

using namespace std;

void waitAndCleanConsole() {
    waitForContinue();
    cleanConsole();
}

int main() {
    system("chcp 65001");
    cleanConsole();
    PersonnelManager pm;

    int choice = 0;

    while (true) {
        pm.showMenu();
        choice = stoi(tipsAndInput("请选择操作："));
        cleanConsole();
        switch (choice) {
            case 1:
                pm.addEmp();
                waitAndCleanConsole();
                break;
            case 2:
                cout << "***** 2.显示员工 *****" << endl;
                pm.showEmps();
                waitAndCleanConsole();
                break;
            case 3:
                cout << "***** 3.删除员工 *****" << endl;
//                deletePerson(&abs);
                waitAndCleanConsole();
                break;
            case 4:
                cout << "***** 4.修改员工 *****" << endl;
//                findPerson(&abs);
                waitAndCleanConsole();
                break;
            case 5:
                cout << "***** 5.查找员工 *****" << endl;
//                modifyPerson(&abs);
                waitAndCleanConsole();
                break;
            case 6:
                cout << "***** 6.排序员工 *****" << endl;
//                cleanAddressBook(&abs);
                waitAndCleanConsole();
                break;
            case 7:
                cout << "***** 7.清空文档 *****" << endl;
//                cleanAddressBook(&abs);
                waitAndCleanConsole();
                break;
            case 0:
                cout << "***** 0.退出系统 *****" << endl;
                pm.existSystem();
            default:
                cout << "没有该选项" << endl;
                break;
        }
    }

    return 0;
}


